package simple;

/**
 * 简单的工厂类
 */
public class IceCreamFactory {

    /**
     * 工厂具体创建冰淇凌的方法
     * @param taste
     * @return
     */
    public  static IceCream  getEat(String taste){
        IceCream iceCream = null;
        switch (taste){
            case "APPLE": iceCream = new AppleIceCream();
            break;
            case "CHERRY": iceCream = new CherryIceCream();
            break;
            default:
                break;
        }
        return iceCream;
    }
}
